plot_annotation(title = "Perceptions of Voluntariness Interacted with Enemy Act") &
theme(plot.title = element_text(hjust = 0.5))
fig10_complete
fig10_complete = fig10a +
fig10b +
plot_annotation(title = "Perceptions of Voluntariness Interacted with Enemy Act") +
theme(plot.title = element_text(hjust = 0.5))
fig10_complete
library("patchwork")
fig10a +
fig10b
fig10a
fig10a +
fig10b
fig10_complete = fig10a + fig10b +
plot_annotation(title = "Perceptions of Voluntariness Interacted with Enemy Act") +
theme(plot.title = element_text(hjust = 0.5))
fig10_complete
library("patchwork")
fig10b
fig10a
library("patchwork")
fig10_complete = fig10a + fig10b +
plot_annotation(title = "Perceptions of Voluntariness Interacted with Enemy Act") +
theme(plot.title = element_text(hjust = 0.5))
fig10_complete
fig10a
fig10b
rm(list = ls())
library(ggthemes)
library(lubridate)
library(estimatr)
library(texreg)
library(tidyverse)
df = readstata13::read.dta13("data/Kao Revkin Retribution or Reconciliation AJPS 2021 Dataset.dta")
# DATA PREP ----------------------------------------------------------------
df = df %>%
mutate(Act = recode(Act, `1` = "IS Fighter",
`2` = "Cook for Fighters",
`3` = "Married a Fighter",
`4` = "Janitor at Municipality",
`5` = "Paid Taxes"),
Act = factor(Act, levels = c("IS Fighter", "Cook for Fighters",
"Married a Fighter", "Janitor at Municipality",
"Paid Taxes"
)),
Woman = recode(Woman, `0` = "Male", `1` = "Female"),
Woman = factor(Woman, levels = c("Male", "Female")),
Youth0 = recode(Youth, `0` = "Elder", `1` = "Youth"),
Youth0 = factor(Youth0, levels = c("Elder", "Youth")),
Tribal_Member = recode(Tribal_Member, `0` = "Not Tribal Member", `1` = "Tribal Member"),
Tribal_Member = factor(Tribal_Member, levels = c("Not Tribal Member", "Tribal Member")))
df = df %>% mutate(Volition = recode(Volition, `0` = "Involuntary",
`1` = "Voluntary"),
Volition = factor(Volition, levels = c("Involuntary",
"Voluntary")),
Act = fct_rev(Act))
mod2 = lm_robust(Punish ~ (Act + Woman + Youth + Tribal_Member)*Volition, clusters = R_ID, data = df)
library(sjPlot)
fig10a = plot_model(mod2, type = "pred", terms = c("Act", "Volition")) +
theme_bw() +
coord_flip(ylim = c(1, 5)) +
theme(legend.position = "bottom") +
scale_color_manual(values = c("black", "gray54")) +
labs(y = "Likelihood of Punishment (Scale: 1-5)", x = "", title = "") +
theme(legend.title = element_blank(), axis.title = element_text(size = 9))
fig10
rm(list = ls())
library(ggthemes)
library(lubridate)
library(estimatr)
library(texreg)
library(tidyverse)
df = readstata13::read.dta13("data/Kao Revkin Retribution or Reconciliation AJPS 2021 Dataset.dta")
# DATA PREP ----------------------------------------------------------------
df = df %>%
mutate(Act = recode(Act, `1` = "IS Fighter",
`2` = "Cook for Fighters",
`3` = "Married a Fighter",
`4` = "Janitor at Municipality",
`5` = "Paid Taxes"),
Act = factor(Act, levels = c("IS Fighter", "Cook for Fighters",
"Married a Fighter", "Janitor at Municipality",
"Paid Taxes"
)),
Woman = recode(Woman, `0` = "Male", `1` = "Female"),
Woman = factor(Woman, levels = c("Male", "Female")),
Youth0 = recode(Youth, `0` = "Elder", `1` = "Youth"),
Youth0 = factor(Youth0, levels = c("Elder", "Youth")),
Tribal_Member = recode(Tribal_Member, `0` = "Not Tribal Member", `1` = "Tribal Member"),
Tribal_Member = factor(Tribal_Member, levels = c("Not Tribal Member", "Tribal Member")))
df = df %>% mutate(Volition = recode(Volition, `0` = "Involuntary",
`1` = "Voluntary"),
Volition = factor(Volition, levels = c("Involuntary",
"Voluntary")),
Act = fct_rev(Act))
mod2 = lm_robust(Punish ~ (Act + Woman + Youth + Tribal_Member)*Volition, clusters = R_ID, data = df)
library(sjPlot)
fig10a = plot_model(mod2, type = "pred", terms = c("Act", "Volition")) +
theme_bw() +
coord_flip(ylim = c(1, 5)) +
theme(legend.position = "bottom") +
scale_color_manual(values = c("black", "gray54")) +
labs(y = "Likelihood of Punishment (Scale: 1-5)", x = "", title = "") +
theme(legend.title = element_blank(), axis.title = element_text(size = 9))
fig10
fig10a
fig10a
# Figure 10b----------------------------------------------------------------
mod3 = lm_robust(Forgive_All ~ (Act + Woman + Youth + Tribal_Member)*Volition, clusters = R_ID, data = df)
fig10b = plot_model(mod3, type = "pred", terms = c("Act", "Volition")) +
theme_bw() +
coord_flip(ylim = c(0, .9)) +
theme(legend.position = "bottom") +
scale_color_manual(values = c("black", "gray54")) +
labs(y = "Likelihood of Forgiveness (Scale: 0-1)", x = "", title = "") +
theme(legend.title = element_blank(), axis.title = element_text(size = 9)) +
scale_y_continuous(breaks = c(0, 0.2, 0.4, 0.6, 0.8))
fig10b
library("patchwork")
library(patchwork)
fig10_complete = fig10a + fig10b +
plot_annotation(title = "Perceptions of Voluntariness Interacted with Enemy Act") +
theme(plot.title = element_text(hjust = 0.5))
fig10_complete
fig10_complete = fig10a + fig10b +
plot_annotation(title = "Perceptions of Voluntariness Interacted with Enemy Act") +
theme(plot.title = element_text(hjust = 0.5))
fig10a + fig10b
fig10a
fig10b
fig10a + fig10b
install.packages("ggplot2")
install.packages("patchwork")
install.packages("patchwork")
install.packages("ggplot2")
rm(list = ls())
library(ggthemes)
library(lubridate)
library(estimatr)
library(texreg)
library(tidyverse)
df = readstata13::read.dta13("data/Kao Revkin Retribution or Reconciliation AJPS 2021 Dataset.dta")
# DATA PREP ----------------------------------------------------------------
df = df %>%
mutate(Act = recode(Act, `1` = "IS Fighter",
`2` = "Cook for Fighters",
`3` = "Married a Fighter",
`4` = "Janitor at Municipality",
`5` = "Paid Taxes"),
Act = factor(Act, levels = c("IS Fighter", "Cook for Fighters",
"Married a Fighter", "Janitor at Municipality",
"Paid Taxes"
)),
Woman = recode(Woman, `0` = "Male", `1` = "Female"),
Woman = factor(Woman, levels = c("Male", "Female")),
Youth0 = recode(Youth, `0` = "Elder", `1` = "Youth"),
Youth0 = factor(Youth0, levels = c("Elder", "Youth")),
Tribal_Member = recode(Tribal_Member, `0` = "Not Tribal Member", `1` = "Tribal Member"),
Tribal_Member = factor(Tribal_Member, levels = c("Not Tribal Member", "Tribal Member")))
# Figure 10A----------------------------------------------------------------
df = df %>% mutate(Volition = recode(Volition, `0` = "Involuntary",
`1` = "Voluntary"),
Volition = factor(Volition, levels = c("Involuntary",
"Voluntary")),
Act = fct_rev(Act))
mod2 = lm_robust(Punish ~ (Act + Woman + Youth + Tribal_Member)*Volition, clusters = R_ID, data = df)
library(sjPlot)
fig10a = plot_model(mod2, type = "pred", terms = c("Act", "Volition")) +
theme_bw() +
coord_flip(ylim = c(1, 5)) +
theme(legend.position = "bottom") +
scale_color_manual(values = c("black", "gray54")) +
labs(y = "Likelihood of Punishment (Scale: 1-5)", x = "", title = "") +
theme(legend.title = element_blank(), axis.title = element_text(size = 9))
fig10a
# Figure 10b----------------------------------------------------------------
mod3 = lm_robust(Forgive_All ~ (Act + Woman + Youth + Tribal_Member)*Volition, clusters = R_ID, data = df)
fig10b = plot_model(mod3, type = "pred", terms = c("Act", "Volition")) +
theme_bw() +
coord_flip(ylim = c(0, .9)) +
theme(legend.position = "bottom") +
scale_color_manual(values = c("black", "gray54")) +
labs(y = "Likelihood of Forgiveness (Scale: 0-1)", x = "", title = "") +
theme(legend.title = element_blank(), axis.title = element_text(size = 9)) +
scale_y_continuous(breaks = c(0, 0.2, 0.4, 0.6, 0.8))
fig10b
library(patchwork)
fig10_complete = fig10a + fig10b +
plot_annotation(title = "Perceptions of Voluntariness Interacted with Enemy Act") +
theme(plot.title = element_text(hjust = 0.5))
fig10_complete
ggsave("figs/irq_fig10.pdf", fig10_complete, height = 5, width = 10)
# Figure 9 ---------------------------------------------------------------
df$Victimization0 = df$Victimization
df = df %>%
mutate(Act = factor(Act, levels = c("IS Fighter", "Cook for Fighters", "Married a Fighter",
"Janitor at Municipality", "Paid Taxes")))
regb5_1 = lm_robust(Punish ~ Victimization0 * (Act + Woman + Youth0 + Tribal_Member), clusters = R_ID, data = df)
regb5_2 = lm_robust(Forgive_All ~ Victimization0 * (Act + Woman + Youth0 + Tribal_Member), clusters = R_ID, data = df)
fig9a = regb5_1 %>%
tidy %>%
filter(!str_detect(term, "Intercept")) %>%
mutate(term = term %>% str_remove("Act") %>%
str_remove("Woman") %>% str_remove("Youth0") %>%
str_remove("Tribal_Member") %>% str_remove("Victimization0"),
term = recode(term, "Victimization:Cook for Fighters" = "Cook X Victimization",
"Victimization:Married a Fighter" = "Married X Victimization",
"Victimization:Janitor at Municipality" = "Janitor X Victimization",
"Victimization:Paid Taxes" = "Paid Taxes X Victimization",
"Victimization:Female" = "Female X Victimization",
"Victimization:Youth" = "Youth X Victimization",
"Victimization:Tribal Member" = "Tribal Member X Victimization"
)) %>%
mutate(term = factor(term, levels = c("Cook for Fighters", "Married a Fighter",
"Janitor at Municipality", "Paid Taxes", "Victimization",
"Cook X Victimization", "Married X Victimization",
"Janitor X Victimization", "Paid Taxes X Victimization",
"Female", "Female X Victimization",
"Youth", "Youth X Victimization",
"Tribal Member", "Tribal Member X Victimization")) %>%
fct_rev()) %>%
ggplot(aes(x = term, y = estimate, ymin = conf.low, ymax = conf.high)) +
geom_pointrange(position = position_dodge(width = .5)) +
geom_text(aes(label = round(estimate, 2)), vjust = -.8, size = 3) +
coord_flip() +
geom_hline(yintercept = 0, linetype = 2, alpha = .2) +
labs(x = "", y = "Change: Harshness of Punishment (1-5)", subtitle = "") +
theme_bw()
fig9a
fig9b = regb5_2 %>%
tidy %>%
filter(!str_detect(term, "Intercept")) %>%
mutate(term = term %>% str_remove("Act") %>%
str_remove("Woman") %>% str_remove("Youth0") %>%
str_remove("Tribal_Member") %>% str_remove("Victimization0"),
term = recode(term, "Victimization:Cook for Fighters" = "Cook X Victimization",
"Victimization:Married a Fighter" = "Married X Victimization",
"Victimization:Janitor at Municipality" = "Janitor X Victimization",
"Victimization:Paid Taxes" = "Paid Taxes X Victimization",
"Victimization:Female" = "Female X Victimization",
"Victimization:Youth" = "Youth X Victimization",
"Victimization:Tribal Member" = "Tribal Member X Victimization"
)) %>%
mutate(term = factor(term, levels = c("Cook for Fighters", "Married a Fighter",
"Janitor at Municipality", "Paid Taxes", "Victimization",
"Cook X Victimization", "Married X Victimization",
"Janitor X Victimization", "Paid Taxes X Victimization",
"Female", "Female X Victimization",
"Youth", "Youth X Victimization",
"Tribal Member", "Tribal Member X Victimization")) %>%
fct_rev()) %>%
ggplot(aes(x = term, y = estimate, ymin = conf.low, ymax = conf.high)) +
geom_pointrange(position = position_dodge(width = .5)) +
geom_text(aes(label = round(estimate, 2)), vjust = -.8, size = 3) +
coord_flip() +
geom_hline(yintercept = 0, linetype = 2, alpha = .2) +
labs(x = "", y = "Change: Willingness to Forgive (0-1)", subtitle = "") +
theme_bw()
fig9b
fig9_complete = fig9a +
fig9b +
plot_annotation(title = "Effects of Respondent Victimization, Base of IS Taxpayer") &
theme(plot.title = element_text(hjust = 0.5))
fig9_complete
ggsave("figs/irq_fig9.pdf", fig9_complete, height = 6, width = 10)
library(tidyverse)
library(ggthemes)
library(googlesheets4)
#Read google sheets data into R
df = read_sheet('https://docs.google.com/spreadsheets/d/1TMsb4uD-OvAZLCPs-sfgs5c-OWGEZHzUd3iYUcrwAoU/edit#gid=1343794949')
library(tidyverse)
library(ggthemes)
library(readxl)
library(readxl)
#Import data
df = read_excel('data/Transitional Justice Literature.xlsx')
df = df[2:nrow(df),]
df$Language %>% table
df = df %>% filter(Language == "English")
#Find number of studies in countries that only showed up once in data
others = df %>%
rename(countries = `Countries of authors' universities`) %>%
select(countries) %>%
separate(countries, into = c("country1", "country2", "country3",
"country4", "country5", "country6"), sep = ";") %>%
pivot_longer(cols = c("country1", "country2", "country3", "country4", "country5", "country6")) %>%
select(value) %>%
filter(complete.cases(value)) %>%
mutate(value = value %>% str_remove("\\(but see note\\)"),
value = value %>% str_remove("^The "),
value = str_trim(value, side = "both"),
value = recode(value, "England" = "United Kingdom",
"Northern Ireland" = "United Kingdom",
"Netherlands" = "The Netherlands"
)) %>%
group_by(value) %>%
summarise(n = n()) %>%
filter(n == 1) %>%
ungroup() %>% summarise(n = sum(n)) %>% pull(n)
#Plot number of studies by country of author. Add a column for other countries from the code above
df %>%
rename(countries = `Countries of authors' universities`) %>%
select(countries) %>%
separate(countries, into = c("country1", "country2", "country3",
"country4", "country5", "country6"), sep = ";") %>%
pivot_longer(cols = c("country1", "country2", "country3", "country4", "country5", "country6")) %>%
select(value) %>%
filter(complete.cases(value)) %>%
mutate(value = value %>% str_remove("\\(but see note\\)"),
value = value %>% str_remove("^The "),
value = str_trim(value, side = "both"),
value = recode(value, "England" = "United Kingdom",
"Northern Ireland" = "United Kingdom",
"Ireland" = "United Kingdom"
)) %>%
group_by(value) %>%
summarise(n = n()) %>%
filter(n > 1) %>%
bind_rows(tibble(value = "Other Countries", n = others)) %>%
ggplot(aes(x = reorder(value, -n), y = n, fill = "a")) +
geom_col() +
scale_fill_grey() +
theme_bw() +
theme(legend.position = "none", axis.text.x = element_text(angle = 45, hjust = 1)) +
labs(x = "Country", y = "Count", subtitle = "Countries of authors' universities")
#Find number of countries that showed up only once
others = df %>%
rename(countries = `Country of study (where participants are from)`) %>%
select(countries) %>%
separate(countries, into = c("country1", "country2", "country3",
"country4", "country5", "country6",
"country7", "country8", "country9",
"country10", "country11", "country12",
"country13", "country14", "country15",
"country16", "country17", "country18",
"country19", "country20", "country21"), sep = ";") %>%
pivot_longer(cols = c("country1", "country2", "country3",
"country4", "country5", "country6",
"country7", "country8", "country9",
"country10", "country11", "country12",
"country13", "country14", "country15",
"country16", "country17", "country18",
"country19", "country20", "country21")) %>%
select(value) %>%
filter(complete.cases(value)) %>%
mutate(value = value %>% str_remove("\\(but see note\\)") %>% trimws(),
value = recode(value, "Democratic Republic of Congo" = "Congo",
"Democratic Republic of the Congo" = "Congo",
"the United States" = "United States",
"the Philippines" = "Philippines",
"Bosnia and\nHerzegovina" = "Bosnia-Herzegovina",
"Bosnia–Herze-\ngovina" = "Bosnia-Herzegovina",
"Columbia" = "Colombia",
),
value = str_trim(value, side = "both")) %>%
group_by(value) %>%
summarise(n = n()) %>%
filter(n == 1) %>%
ungroup() %>% summarise(n = sum(n)) %>% pull(n)
#Plot number of studies by country. Add a column for other countries from the code above
df %>%
rename(countries = `Country of study (where participants are from)`) %>%
select(countries) %>%
separate(countries, into = c("country1", "country2", "country3",
"country4", "country5", "country6",
"country7", "country8", "country9",
"country10", "country11", "country12",
"country13", "country14", "country15",
"country16", "country17", "country18",
"country19", "country20", "country21"), sep = ";") %>%
pivot_longer(cols = c("country1", "country2", "country3",
"country4", "country5", "country6",
"country7", "country8", "country9",
"country10", "country11", "country12",
"country13", "country14", "country15",
"country16", "country17", "country18",
"country19", "country20", "country21")) %>%
select(value) %>%
filter(complete.cases(value)) %>%
#filter(str_detect(value, "Bosnia")) %>% pull(value) %>% unique
mutate(value = value %>% str_remove("\\(but see note\\)") %>% trimws(),
value = recode(value, "Democratic Republic of Congo" = "Congo",
"Democratic Republic of the Congo" = "Congo",
"the United States" = "United States",
"the Philippines" = "Philippines",
"Bosnia and\nHerzegovina" = "Bosnia-Herzegovina",
"Columbia" = "Colombia",
"United Kingdom (Northern Ireland)" = "Northern Ireland"
),
value = str_trim(value, side = "both")) %>%
group_by(value) %>%
summarise(n = n()) %>%
filter(n > 1) %>%
bind_rows(tibble(value = "Other Countries", n = others)) %>%
ggplot(aes(x = reorder(value, -n), y = n, fill = "a")) +
geom_col() +
scale_fill_grey() +
theme_bw() +
theme(legend.position = "none", axis.text.x = element_text(angle = 45, hjust = 1)) +
labs(x = "Country", y = "Count", subtitle = "Countries of study")
#Note: Some studies use multiple research methods
df_plot = df %>%
rename(method = `Research Method`, year = `Publication year`) %>%
select(method, year) %>%
mutate(year = year %>% unlist,
year = year %>% as.numeric,
) %>%
separate(method, into = c("method1", "method2", "method3",
"method4", "method5"), sep = ";") %>%
pivot_longer(cols = c("method1", "method2", "method3",
"method4", "method5")) %>%
select(year, value) %>%
filter(complete.cases(value),
complete.cases(year)) %>%
mutate(value = str_trim(value, side = "both"),
value = value %>% str_replace("^other.+", "other"),
value = recode(value, "interview" = "interviews",
"field experiment" = "field experiments",
"natural experiment" = "natural experiments",
"lab-in-field experiment" = "lab-in-field experiments",
"survey" = "surveys",
"survey experiment" = "survey experiments",
"participatory observation" = "participant observation")) %>%
group_by(year, value) %>%
summarise(n = n())
df_plot$value %>% table
#Complete dataset with missing year-method combinations
all_years <- seq(1999, 2023)
all_values <- unique(df_plot$value)
expanded_data <- expand.grid(year = all_years, value = all_values)
#Merge the two
df_plot = df_plot %>%
right_join(expanded_data) %>%
mutate(n = case_when(is.na(n) ~ 0,
TRUE ~ n))
df_plot %>%
mutate(value = factor(value, levels = c("interviews",
"focus groups",
"participant observation",
"surveys",
"survey experiments",
"field experiments",
"lab-in-field experiments",
"natural experiments",
"public testimony",
"text analysis",
"case-control study",
"other"))) %>%
ggplot(aes(x = year, y = n)) +
geom_line() +
scale_color_grey() +
theme_bw() +
facet_wrap(~ value) +
labs(x = "Year", y = "Count", subtitle = "Study methods over time")
ggsave("figs/method_time.pdf", height = 4, width = 7)
# Justic Mechanism ----------------------------------------------------
df %>%
rename(mechanism = `TJ Mechanisms (MR Simplified Coding)`) %>%
select(mechanism) %>%
mutate(mechanism = mechanism %>% str_replace_all(",", ";")) %>%
separate(mechanism, into = c("mechanism1", "mechanism2", "mechanism3",
"mechanism4",  "mechanism5", "mechanism6",
"mechanism7", "mechanism8"), sep = ";") %>%
pivot_longer(cols = c("mechanism1", "mechanism2", "mechanism3",
"mechanism4",  "mechanism5", "mechanism6",
"mechanism7", "mechanism8")) %>%
select(value) %>%
filter(complete.cases(value)) %>%
mutate(value = str_trim(value, side = "both"),
value = value %>% str_replace("\\([^()]*\\)", ""),
value = value %>% str_to_title(),
value = recode(value, "Ddr" = "DDR"),
value = str_trim(value, side = "both")
) %>%
group_by(value) %>%
summarise(n = n()) %>%
ggplot(aes(x = reorder(value, -n), y = n, fill = "a")) +
geom_col() +
scale_fill_grey() +
theme_bw() +
theme(legend.position = "none", axis.text.x = element_text(angle = 45, hjust = 1)) +
labs(x = "Mechanism", y = "Count", subtitle = "Transitional justice mechanism")
sessionInfo()
library(ggthemes)
library(lubridate)
library(estimatr)
library(texreg)
library(tidyverse)
library(readstata13)
library(sjPlot)
library(patchwork)
library(ggthemes)
library(lubridate)
library(estimatr)
library(texreg)
library(tidyverse)
library(tidyverse)
library(estimatr)
library(texreg)
library(ggthemes)
library(arsenal)
sessionInfo()
rm(list = ls())
library(readr)
library(dplyr)
library(tidyr)
library(ggplot2)
library(labelled)
library(vtable)
library(fect)
data <- read_csv('../03data/Table 4a - Subset east (ESS).csv')
